package com.yue.pattern.singleton;

/**
 * 线程安全， 但是效率低。 不推荐使用
 * Created by qiuyang on 06/04/2017.
 */
public class LazySyncSingleton {
    private static LazySyncSingleton lazySyncSingleton = null;

    private LazySyncSingleton() {}

    public synchronized static LazySyncSingleton getInstance() {
        if (lazySyncSingleton == null) {
            lazySyncSingleton = new LazySyncSingleton();
        }

        return lazySyncSingleton;
    }
}
